package com.jinkaimen.kqb.ui.holder;

import android.widget.ImageView;
import android.widget.TextView;

import com.ht.baselibs.ui.base.BaseViewHolder;
import com.ht.baselibs.utils.DateUtils;
import com.jinkaimen.kqb.R;
import com.jinkaimen.kqb.bean.NotifyListBean;
import com.jinkaimen.kqb.bean.NotifyNewsBean;

/**
 * Created by Admin on 2017/8/14.
 */
public class NotifyViewHolder extends BaseViewHolder<NotifyListBean.ListBean> {

    private TextView mTvShowNews, mTvNewsTime;
    private ImageView mIvShowNewsRedHint;

    public NotifyViewHolder() {
        super(R.layout.list_notify_news_item);
    }

    @Override
    protected void initView() {
        mTvShowNews = findViewById(R.id.tv_show_news);
        mTvNewsTime = findViewById(R.id.tv_news_time);
        mIvShowNewsRedHint = findViewById(R.id.iv_show_news_red_hint);
    }

    @Override
    protected void refreshView(NotifyListBean.ListBean listBean) {
        mTvShowNews.setText(listBean.content);
        long time = listBean.createTime;
        if (time != 0) {
            String timeHMS = DateUtils.formatDateTimeHMS(time);
            mTvNewsTime.setText(timeHMS);
        }
    }
}
